package com.book.service.impl;

import com.book.model.TAuthor;
import com.book.mapper.TAuthorDao;
import com.book.service.TAuthorService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wx
 * @since 2023-10-13 10:49:13
 */
@Service
public class TAuthorServiceImpl extends ServiceImpl<TAuthorDao, TAuthor> implements TAuthorService {
    @Autowired
    private TAuthorDao tAuthorDao;
    @Override
    public List<TAuthor> getAllAuthor() {
        List<TAuthor> tAuthors = tAuthorDao.selectList(null);
        return tAuthors;
    }

    @Override
    public void addAuthou(TAuthor tAuthor) {
        tAuthorDao.insert(tAuthor);
    }

    @Override
    public void deleteAuthor(Long id) {
        tAuthorDao.deleteById(id);
    }

    @Override
    public void updateAuthor(TAuthor tAuthor) {
        tAuthorDao.updateById(tAuthor);
    }
}
